package com.lcn.consumer.lcnconsumer.bean;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;


@Data
@Entity   // 指定自动生成表的名称为当前类的类名
// SpringMVC HttpMessageConverter
// Jackson
// JPA默认的底层实现是Hibernate，其默认采用延迟加载策略
// Depart depart = service.findById(5);  javasist
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler", "fieldHandler"})
public class Depart {
    @Id  // 指定当前属性为生成表的主键
    @GeneratedValue(strategy = GenerationType.IDENTITY)   // 主键自动递增
    private Integer id;
    private String name;
}
